<template>
	<view>
		<CustomNavBar @networkChanged="fetchData"></CustomNavBar>
		<CustomTabBar :currentPage="currentPage"></CustomTabBar>
		<!-- 内容 -->
		<view class="content">
			<image class="header-img" src="/static/bigImg/lunboye.jpg"></image>
			<!-- 轮播 -->
			<view class="container">
			  <view class="scroll-container">
			    <view 
			      class="data-list" 
			      :style="{ transform: `translateY(${-scrollPosition}px)` }"
			      :class="{ 'scroll-animation': shouldAnimate }"
			    >
			      <view class="data-item" v-for="(item, index) in dataList" :key="index">
			        <text class="address">{{ item.address }}</text>
			        <text class="amount">+{{ item.income }}{{cointype}}</text>
			      </view>
			    </view>
			  </view>
			</view>
			<!-- 展示问答 -->
			<view class="faq-container">
			  <!-- 标题 -->
			  <view class="faq-title">FAQs</view>
			  
			  <!-- 问题列表 -->
			  <view class="faq-item" v-for="(item, index) in faqList" :key="index" @click="toggleFAQ(index)">
			    <view class="question-container">
			      <text class="question-text">{{ item.question }}</text>
			      <image 
			        class="arrow-icon"
			        :src="item.expanded ? '/static/commonImg/drom.png' : '/static/commonImg/left.png'" 
			        mode="aspectFit"
			      />
			    </view>
			    
			    <!-- 答案内容，根据状态显示/隐藏 -->
			    <view class="answer-container" v-show="item.expanded">
			      <text class="answer-text">{{ item.answer }}</text>
			    </view>
			  </view>
			</view>
			
		</view>
	</view>
</template>

<script src="./index.js"></script>
<style src="./index.scss" lang="scss"></style>